import request from '@/utils/request'

export function fetchParentList(query) {
  return request({
    url: '/auth/permission',
    method: 'get',
    params: query
  })
}

export function fetchNodeList(query) {
  return request({
    url: '/auth/permissionSelect',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: {id}
  })
}

export function deletePermission(id,pv) {
  return request({
    url: '/auth/permission/' + id,
    method: 'delete'
  })
}

export function createPermission(data) {
  return request({
    url: '/auth/permission',
    method: 'post',
    data
  })
}

export function updatePermission(id, data) {
  return request({
    url: '/auth/permission/' + id,
    method: 'put',
    data
  })
}
